
#ifndef CENTITY_H
#define CENTITY_H

#include <iostream>
#include <vector>
#include <stdexcept>

class CEntity
{
    // Variables
    private:
    protected:
        const std::size_t _id;
        const std::size_t _nDim;
        std::size_t _nFacePoint;

        std::vector<size_t> point;
        double* CG;
        double volume;
        std::vector<size_t> face;
        std::size_t type;
        long int boundType;
    public:
        std::vector<size_t> parent;
        std::vector<size_t> neighborPoint;
        std::vector<size_t> neighborLine;
        double* normal;


    // Methods
    private:
    protected:
    public:
        CEntity(std::size_t aId, std::size_t aNDim);
        virtual ~CEntity();
        void init(CEntity** aPointList);
        std::size_t getId();
        std::size_t getNPoint();
        std::size_t getNDim();
        std::size_t getNFace();
        double getCG(size_t aDim);
        double* getCG();
        void setCG(double* aCG);
        std::size_t getPoint(std::size_t aPoint);
        double getType();
        void setType(std::size_t aType);
        virtual std::size_t* getFacePoint(std::size_t aFace);
        std::size_t getNFacePoint();
        std::size_t getParent(std::size_t aParent);
        std::size_t getNParent();
        int findNeighborPoint(size_t aPoint);
        double getVolume();
        virtual void setVolume(double value);
        void setBoundType(long int val);
        long int getBoundType();
}; //:~ CEntity

class CPoint : public CEntity
{
    // Variables
    private:
    protected:
    public:
    // Methods
    private:
    protected:
    public:
        CPoint(std::size_t aId, std::size_t aNDim);
        ~CPoint();
};

class CLine : public CEntity
{
    // Variables
    private:
    protected:
    public:
    // Methods
    private:
    protected:
    public:
        CLine(std::size_t aId, std::size_t aNDim);
        ~CLine();
};

class CTriangle : public CEntity
{
    // Variables
    private:
    protected:
    public:
    // Methods
    private:
    protected:
    public:
        CTriangle(std::size_t aId, std::size_t aNDim);
        ~CTriangle();
        std::size_t* getFacePoint(std::size_t aFace);
};

class CRectangle: public CEntity
{
    // Variables
    private:
    protected:
    public:
    // Methods
    private:
    protected:
    public:
        CRectangle(std::size_t aId, std::size_t aNDim);
        ~CRectangle();
        std::size_t* getFacePoint(std::size_t aFace);
};


#include "CEntity.inl"

#endif //:~ CENTITY_H
